In recent years, the storage apparatus including a controller configured to control a nonvolatile memory has been developed. This controller controls to write data to the nonvolatile memory or read data from the nonvolatile memory. Data is encoded and written to the nonvolatile memory. The data stored in the nonvolatile memory is read and decoded.
Technologies of correcting error in the data read from the nonvolatile memory have also been developed. In the technologies, when writing the data to the nonvolatile memory, an ECC (Error Checking and Correcting Code) is generated from the data to be written. The error that occurs in the data when reading the data from the nonvolatile memory can be corrected using the ECC. Using a plurality of ECCs of different error correcting capabilities enables to decrease the number of errors in the read data.
However, to use a plurality of ECCs, for example, in addition to a buffer or the like to temporarily store data read using an ECC having low error correcting capability, a buffer or the like to temporarily store data read using an ECC having high error correcting capability is needed. That is, the circuit scale of a buffer or the like in the controller becomes large. Additionally, control using a plurality of ECCs is generally complex. For this reason, it is necessary to facilitate control for the plurality of ECCs.